import 'package:flutter/material.dart';

class ARow extends StatelessWidget {
  final double? height;
  final Widget? leftChild;
  final Widget? centerChild;
  final Widget? rightChild;
  final EdgeInsets? padding;
  final EdgeInsets? margin;
  final Border? border;
  final Color? color;
  final Function? onPressed;

  const ARow({
    super.key,
    this.height,
    this.leftChild,
    this.centerChild,
    this.rightChild,
    this.border,
    this.padding,
    this.margin,
    this.color,
    this.onPressed,
  });

  @override
  Widget build(BuildContext context) {
    return InkWell(
      highlightColor: onPressed == null ? Colors.transparent : null,
      splashColor: onPressed == null ? Colors.transparent : null,
      child: Container(
        height: height,
        padding: padding ?? EdgeInsets.symmetric(horizontal: 15),
        margin: margin ?? EdgeInsets.all(0),
        decoration: BoxDecoration(
          color: color ?? Colors.white,
          border: border ?? Border(bottom: BorderSide(width: 1, color: Color.fromRGBO(242, 242, 242, 1))),
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            leftChild ?? Container(),
            Expanded(child: centerChild ?? Container()),
            rightChild ?? Container(),
          ],
        ),
      ),
      onTap: () => onPressed?.call(),
    );
  }
}
